// ignore_for_file: empty_constructor_bodies

import 'package:flutter/material.dart';

class AppBarWithDrawer extends StatefulWidget {
  const AppBarWithDrawer({super.key, required this.title});
  final String title;
  @override
  State<StatefulWidget> createState() => _AppBarWithDrawerState();
}

class _AppBarWithDrawerState extends State<AppBarWithDrawer> {
  void accountInfo() {}

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 3,
      child: Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
          centerTitle: false,
          actions: <Widget>[
            IconButton(
                onPressed: accountInfo,
                isSelected: false,
                icon: const Icon(Icons.account_circle)),
            const CircleAvatar(
              maxRadius: 11,
              minRadius: 9,
              // radius: 10,
              backgroundImage: AssetImage("assets/images/avatar-48.png"),
            )
          ],
          bottom: TabBar(tabs: <Widget>[
            Tab(text: "需求评审"),
            Tab(
              text: "开发中",
            ),
            Tab(
              text: "提测",
            ),
          ]),
        ),
        drawer: Drawer(
          child: ListView(
            padding: EdgeInsets.zero,
            children: const <Widget>[
              DrawerHeader(
                decoration: BoxDecoration(
                  color: Colors.pink,
                ),
                child: Text(
                  "项目列表",
                  style: TextStyle(color: Colors.white),
                ),
              ),
              ListTile(
                title: Text("app开发"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
